/*
 ============================================================================
 Name		: NfcEngine.h
 Author	  : 
 Version	 : 1.0
 Copyright   : 
 Description : CNfcEngine declaration
 ============================================================================
 */

#ifndef NFCENGINE_H
#define TESTENGINE_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <f32file.h>

#include "EnumConverterCleanup.h"
#include "StringMap.h"
#include "scatu/Utils.h"

// CLASS DECLARATION

class CNfcClient;
class CP2PManager;

/**
 *  CNfcEngine
 * 
 */
class CNfcEngine : public CBase
    {
public:
    ~CNfcEngine();
    static CNfcEngine* NewL();
    static CNfcEngine* NewLC();
    
public:
    
    void ReadTagAsyncL(scatu::MFunctor<HBufC8 *> & aRet, TDesC8 const & aWidgetId, TDesC8 const & aTnf, TDesC8 const & aType, TInt aTimeout);
    void SetForegroundL(TDesC8 const & aWidgetId, TBool aOnForeground);
    
    TInt SendMessageL(const TDesC8 & aWidgetId, const TDesC8 & aMessageId, const TDesC8 & aContent, TInt aValidFor);
    TInt SetResponseL(const TDesC8 & aWidgetId, const TDesC8 & aMessageId, const TDesC8 & aContent, TInt aValidFor);
    HBufC8 * TransactionLogL(const TDesC8 & aWidgetId);
    
private:
    CNfcEngine();
    void ConstructL();
    
private:
    
    CNfcClient * ClientByIdL(TDesC8 const & aWidgetId);
    
    // Make EnumConverter usable while this class in instantiated
    REnumConverterCleanup iEnumCleanup;
    
    RStringMap<CNfcClient> iClients;
    
    RFs iFs;

    CP2PManager * iP2PManager; 

    };

#endif // NFCENGINE_H
